package com.example.core.convert.utils;

import com.example.utils.SpringUtils;

import javax.persistence.EntityManager;

public class ConvertorUtils {
    private static ConvertorUtils instance = null;

    private EntityManager entityManager = null;

    private ConvertorUtils() {

    }

    public static ConvertorUtils getInstance() {
        if (instance == null) {
            instance = new ConvertorUtils();
        }
        return instance;
    }

    public EntityManager getEntityManager() {
        if (this.entityManager == null) {
            this.entityManager = SpringUtils.getBean(EntityManager.class);
        }
        return this.entityManager;
    }
}
